package org.thomias.exo3.map;

import java.net.URI;

public class Map {

	public static void main(String[] args) {
		java.util.Map<String, String> map = null;
		try {
			map = new FTPMap(new URI("ftp://Yannis:k@localhost:21/persistant_map"));
			for (int i = 0; i < 10; i++) {
				String key = "Key_" + i;
				String value = "Hello World " + i;
				map.put(key, value);
			}

			for (String k : map.keySet()) {
				println("k=" +k);
				String v = map.get(k);
				println(k + " = " + v);
			}

		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			map.clear();
		}

	}

	private static void println(String text) {
		System.out.println(text);

	}

}
